﻿namespace HBFramework
{
    /// <summary>
    /// AStar点
    /// </summary>
    public class Point
    {
        public Point parent;

        public float F { get; set; }
        public float G { get; set; }
        public float H { get; set; }

        public int X { get; private set; }
        public int Y { get; private set; }

        public int Type { get; set; }

        public Point(int x, int y, int type)
        {
            X = x;
            Y = y;
            Type = type;
        }

        public void UpdateParent(Point parent, float g)
        {
            this.parent = parent;
            G = g;
            F = G + H;
        }
    }
}